package it.polimi.traveldream.ejbclient.eaos;

import it.polimi.traveldream.ejbclient.dtos.BaseProductDTO;
import it.polimi.traveldream.ejbclient.dtos.ExcursionDTO;
import it.polimi.traveldream.ejbclient.dtos.HotelDTO;
import it.polimi.traveldream.ejbclient.dtos.TransportDTO;
import it.polimi.traveldream.utils.enums.BaseProductType;
import it.polimi.traveldream.utils.exceptions.JustInUseException;
import it.polimi.traveldream.utils.exceptions.NotCoherentException;
import it.polimi.traveldream.utils.exceptions.NotSuchProductException;

import java.util.Date;
import java.util.List;

import javax.ejb.Local;

@Local
public interface BaseProductServiceEAO {
	public List<TransportDTO> getAvailableTransports(Date start, Date end, int reservations);
	public List<HotelDTO> getAvailableHotels(Date start, Date end, int reservations);
	public List<ExcursionDTO> getAvailableExcursions(Date start, Date end, int reservations);
	public List<TransportDTO> getTransports(boolean overpast);
	public List<HotelDTO> getHotels(boolean overpast);
	public List<ExcursionDTO> getExcursions(boolean overpast);
	public HotelDTO getHotel(int hotelId) throws NotSuchProductException;
	public TransportDTO getTransport(int transportId) throws NotSuchProductException;
	public ExcursionDTO getExcursion(int excursionId) throws NotSuchProductException;
	public boolean isAvailableFor(int productId, BaseProductType type, int reservations)
			throws NotSuchProductException;
	public boolean isOverpast(int productId, BaseProductType type)
			throws NotSuchProductException;
	public int addProduct(BaseProductDTO product) throws NotCoherentException;
	public void modifyProduct(BaseProductDTO product) throws NotCoherentException, NotSuchProductException, JustInUseException;
	public void deleteProduct(int productId, BaseProductType type)
			throws NotSuchProductException, JustInUseException;
	public boolean justInPackage(int productId, BaseProductType type)
			throws NotSuchProductException;
}
